import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'
import FindPage from '@/views/parking/MonthcardManage/FindPage.vue'
import AddPage from '@/views/parking/MonthcardManage/AddPage.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      hidden: true,
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('@/views/login/index.vue')
    },
    {
      path: '/part/',
      component: () => import('@/views/pole/particularsPage/index.vue'),
      meta: {
        title: '详情'
      },
      hidden: true
    },
    {
      path: '/rolechange',
      name: 'RoleChange',
      hidden: true,
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('@/views/system-management/RoleManage/RoleChange/index.vue')
    },
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: '', // 二级路由的path什么都不写表示它是默认二级路由
          component: () => import('@/views/dashboard/index.vue'),
          meta: {
            title: '工作台',
            icon: 'FundProjectionScreenOutlined'
          }
        }
      ]
    },
    {
      path: '/addenterprise',
      component: () => import('@/views/park/EnterpriseManage/components/AddEnterprise.vue'),
      meta: {
        title: '添加企业'
      },
      hidden: true
    },
    {
      path: '/editor/:id?',
      component: () => import('@/views/park/EnterpriseManage/components/EditoriaEnterprise.vue'),
      meta: {
        title: '编辑'
      },
      hidden: true
    },
    {
      path: '/examine/:id?',
      component: () => import('@/views/park/EnterpriseManage/components/ExaminePage.vue'),
      meta: {
        title: '查看'
      },
      hidden: true
    },
    {
      path: '/park',
      component: Layout,
      meta: {
        title: '园区管理',
        icon: 'DatabaseOutlined'
      },
      children: [
        {
          path: '/park/building',
          component: () => import('@/views/park/BuildingManage/index.vue'),
          meta: {
            title: '楼宇管理'
          }
        },
        {
          path: '/park/Enterprise',
          component: () => import('@/views/park/EnterpriseManage/index.vue'),
          meta: {
            title: '企业管理'
          }
        }
      ]
    },
    {
      path: '/parking',
      component: Layout,
      meta: {
        title: '行车管理',
        icon: 'CarOutlined'
      },
      children: [
        {
          path: '/parking/area',
          component: () => import('@/views/parking/AreaManage/index.vue'),
          meta: {
            title: '区域管理'
          }
        },
        {
          path: '/parking/monthcard/',
          component: () => import('@/views/parking/MonthcardManage/index.vue'),
          meta: {
            title: '月卡管理'
          }
        },
        {
          path: '/parking/carpay',
          component: () => import('@/views/parking/CarPayManage/index.vue'),
          meta: {
            title: '停车缴费管理'
          }
        },
        {
          path: '/parking/billing',
          component: () => import('@/views/parking/BillingManage/index.vue'),
          meta: {
            title: '计费规则管理'
          }
        }
      ]
    },
    {
      path: '/Propertycostsmanage',
      component: Layout,
      children: [
        {
          path: '', // 二级路由的path什么都不写表示它是默认二级路由
          component: () => import('@/views/Property-costs-manage/index.vue'),
          meta: {
            title: '物业费管理',
            icon: 'DollarOutlined'
          }
        }
      ]
    },
    {
      path: '/pole',
      component: Layout,
      meta: {
        title: '一体杆管理',
        icon: 'WifiOutlined'
      },
      children: [
        {
          path: '/pole/onemanage',
          component: () => import('@/views/pole/OneManage/index.vue'),
          meta: {
            title: '一体杆管理'
          }
        },
        {
          path: '/pole/warningrecords/',
          component: () => import('@/views/pole/WarningRecords/index.vue'),
          meta: {
            title: '告警记录'
          }
        }
      ]
    },
    {
      path: '/system',
      component: Layout,
      meta: {
        title: '系统管理',
        icon: 'UnorderedListOutlined'
      },
      children: [
        {
          path: '/system/StaffManage',
          component: () => import('@/views/system-management/StaffManage/index.vue'),
          meta: {
            title: '员工管理'
          }
        },
        {
          path: '/system/rolemanage',
          component: () => import('@/views/system-management/RoleManage/index.vue'),
          meta: {
            title: '角色管理'
          }
        }
      ]
    },
    {
      path: '/findcard/:id?',
      hidden: true,
      component: FindPage
    },
    {
      path: '/addcard/',
      hidden: true,
      component: AddPage
    }
  ]
})

export default router
